<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let arr1=["1","3","5","7","9","2","8","7"]
       let arr= arr1.filter(n => n >= 3 && n % 2 === 0)
        console.log(arr)

        let arr2 = ["1","3","5","7","9","2","8","7"];
        const result1 = arr2.filter(n => { 
        return n>= 3 && n % 2 === 0  });
        //2.查找函数find只找到第一个符合的元素就返回
        let resArr1 =arr2.find(value=>value>=3)
        console.log(resArr1)
        //3.map函数:对数组做处理
        console.log(arr2.map((value,index,arr)=>{
            console.log(value)
            console.log(index)
            console.log(arr)
            return value="A"
        }))
        //4.增删改
        arr2.push(567)
        console.log(arr2)
        arr2.unshift(231)
        console.log(arr2)
        arr2.splice(1,2)
        console.log(arr2)
        </script>
</body>
</html>